IF COL_LENGTH('ProductVariant', 'AllowedReserved') IS NULL
BEGIN
	ALTER TABLE ProductVariant 
	ADD AllowedReserved bit NULL
END
GO
Update ProductVariant Set AllowedReserved = 0

GO
IF COL_LENGTH('Topic', 'PictureId') IS NULL
BEGIN
	ALTER TABLE Topic 
	ADD PictureId INT NULL

	ALTER TABLE [dbo].[Topic]  WITH CHECK ADD CONSTRAINT [FK_Topic_Picture] FOREIGN KEY([PictureId])
	REFERENCES [dbo].[Picture] ([Id])

	ALTER TABLE [dbo].[Topic] CHECK CONSTRAINT [FK_Topic_Picture]
END

